<!-- 监控维度 -->
<template>
  <a-card title="监控维度" :bordered="false">
    <div v-for="(item, index) in dimList" :key="index" class="dim-box">
      <div class="label-box">{{ item.label }}</div>
      <div class="check-box">
        <div
          v-for="(cItem, cIndex) in item.tabList"
          :key="cIndex"
          :class="['check-item', formData[cItem.value] ? 'selected' : '']"
          @click="onDimSelect(cItem.value)">
          {{ cItem.label }}
        </div>
      </div>
    </div>
  </a-card>
</template>

<script>
export default {
  name: 'MonitoringDimensionality',
  props: {
    isLook: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      formData: {
        // 全部
        all: false,
        // 重大事件
        registerCapitalChange: false,
        enterpriseTypeChange: false,
        licenseNumChange: false,
        branchOfficeChange: false,
        judicialAuction: false,
        chattelMortgage: false,
        equityPledge: false,
        oweTaxInfo: false,
        operatingAnomaly: false,
        breakPromiseInfo: false,
        legalPersonExecution: false,
        majorIllegalTaxEvasion: false,
        // 中度事件
        businessScopeChange: false,
        chargePersonChange: false,
        stockholderEquityChange: false,
        investChange: false,
        staffChange: false,
        enterpriseNameChange: false,
        membershipChange: false,
        // 轻度事项
        addressChange: false,
        contactInfoChange: false,
        timeLimitChange: false,
        judicialDocument: false,
        courtAnnouncement: false,
        openAnnouncement: false,
        administrativePunishment: false,
        judicialAssistance: false,
        equityFreeze: false,
        filingInfo: false,
        // 提醒事项
        otherChange: false,
        trademarkInfo: false,
        patentInfo: false,
        newsTrends: false,
        spotCheck: false,
        bid: false,
        outwardInvestment: false,
        softwareCopyright: false,
      },
      dimList: [
        {
          label: '全部',
          tabList: [
            { label: '全部维度', value: 'all' }
          ]
        },
        {
          label: '重大事件',
          tabList: [
            { label: '注册资金变更', value: 'registerCapitalChange' },
            { label: '企业类型变更', value: 'enterpriseTypeChange' },
            { label: '证照号变更', value: 'licenseNumChange' },
            { label: '分支机构变更', value: 'branchOfficeChange' },
            { label: '司法拍卖', value: 'judicialAuction' },
            { label: '动产抵押', value: 'chattelMortgage' },
            { label: '股权出质', value: 'equityPledge' },
            { label: '欠税信息', value: 'oweTaxInfo' },
            { label: '经营异常', value: 'operatingAnomaly' },
            { label: '失信信息', value: 'breakPromiseInfo' },
            { label: '法人被执行', value: 'legalPersonExecution' },
            { label: '重大违法逃税', value: 'majorIllegalTaxEvasion' },
          ]
        },
        {
          label: '中度事件',
          tabList: [
            { label: '经营范围变更', value: 'businessScopeChange' },
            { label: '负责人变更', value: 'chargePersonChange' },
            { label: '股东股权变更', value: 'stockholderEquityChange' },
            { label: '投资变更', value: 'investChange' },
            { label: '人员变更', value: 'staffChange' },
            { label: '企业名称变更', value: 'enterpriseNameChange' },
            { label: '隶属关系变更', value: 'membershipChange' },
          ]
        },
        {
          label: '轻度事项',
          tabList: [
            { label: '地址变更', value: 'addressChange' },
            { label: '联系方式变更', value: 'contactInfoChange' },
            { label: '期限变更', value: 'timeLimitChange' },
            { label: '裁判文书', value: 'judicialDocument' },
            { label: '法院公告', value: 'courtAnnouncement' },
            { label: '开庭公告', value: 'openAnnouncement' },
            { label: '行政处罚', value: 'administrativePunishment' },
            { label: '司法协助', value: 'judicialAssistance' },
            { label: '股权冻结', value: 'equityFreeze' },
            { label: '立案信息', value: 'filingInfo' },
          ]
        },
        {
          label: '提醒事项',
          tabList: [
            { label: '其他变更', value: 'otherChange' },
            { label: '商标信息', value: 'trademarkInfo' },
            { label: '专利信息', value: 'patentInfo' },
            { label: '新闻动态', value: 'newsTrends' },
            { label: '抽查检查', value: 'spotCheck' },
            { label: '招投标', value: 'bid' },
            { label: '对外投资', value: 'outwardInvestment' },
            { label: '软件著作权', value: 'softwareCopyright' },
          ]
        },
      ],
    }
  },
  methods: {
    setParams() {},
    getParams(isValidate) {
      let params = null;
      if (isValidate) {
        params = { ...this.formData };
      } else {
        params = { ...this.formData };
      }
      return params;
    },
    onDimSelect(name) {
      if (!this.isLook) {
        this.formData[name] = !this.formData[name];
      }
    },
  }
}
</script>

<style lang="less" scoped>

.dim-box {
  display: flex;
  .label-box {
    display: flex;
    width: 80px;
  }
  .check-box {
    display: flex;
    flex-wrap: wrap;
    .check-item {
      border-radius: 4px;
      text-align: center;
      border: 1px solid rgba(187, 187, 187, 1);
      padding: 5px 10px;
      margin: 0 10px 10px 0;
      cursor: pointer;
    }
    .selected {
      border: 1px solid #1890FF;
      color: #1890FF;
    }
  }
}
</style>